home *** CD-ROM | disk | FTP | other *** search
/ Ian & Stuart's Australian Mac 1993 September / September 93.iso / Archives / Applications / Assorted Programs / PCB Cad / CELL.H < prev    next >
Encoding:
C/C++ Source or Header  |  1990-10-13  |  3.0 KB  |  76 lines  |  [TEXT/UNIX]

  1. #define far
  2. #define _fmalloc malloc
  3. #define _ffree free
  4. #define Alloc malloc
  5. #define stricmp strcmp
  6. #define Dot(c,y,x)    { MoveTo(x,y); LineTo(x,y); }
  7.  
  8. /* the low-order bit indicates a hole */
  9. #define HOLE            0x00000001L    /* a conducting hole */
  10.  
  11. /* traces radiating outward from a hole to a side or corner */
  12. #define HOLE_NORTH        0x00000002L    /* upward        */
  13. #define HOLE_NORTHEAST        0x00000004L    /* upward and right    */
  14. #define HOLE_EAST        0x00000008L    /* to the right        */
  15. #define HOLE_SOUTHEAST        0x00000010L    /* downward and right    */
  16. #define HOLE_SOUTH        0x00000020L    /* downward        */
  17. #define HOLE_SOUTHWEST        0x00000040L    /* downward and left    */
  18. #define HOLE_WEST        0x00000080L    /* to the left        */
  19. #define HOLE_NORTHWEST        0x00000100L    /* upward and left    */
  20.  
  21. /* straight lines through the center */
  22. #define LINE_HORIZONTAL        0x00000002L    /* left-to-right line    */
  23. #define LINE_VERTICAL        0x00000004L    /* top-to-bottom line    */
  24.  
  25. /* lines cutting across a corner, connecting adjacent sides */
  26. #define CORNER_NORTHEAST    0x00000008L    /* upper right corner    */
  27. #define CORNER_SOUTHEAST    0x00000010L    /* lower right corner    */
  28. #define CORNER_SOUTHWEST    0x00000020L    /* lower left corner    */
  29. #define CORNER_NORTHWEST    0x00000040L    /* upper left corner    */
  30.  
  31. /* diagonal lines through the center */
  32. #define DIAG_NEtoSW        0x00000080L    /* northeast to southwest */
  33. #define DIAG_SEtoNW        0x00000100L    /* southeast to northwest */
  34.  
  35. /* 135 degree angle side-to-far-corner lines */
  36. #define BENT_NtoSE        0x00000200L    /* north to southeast    */
  37. #define BENT_NtoSW        0x00000400L    /* north to southwest    */
  38. #define BENT_EtoSW        0x00000800L    /* east to southwest    */
  39. #define BENT_EtoNW        0x00001000L    /* east to northwest    */
  40. #define BENT_StoNW        0x00002000L    /* south to northwest    */
  41. #define BENT_StoNE        0x00004000L    /* south to northeast    */
  42. #define BENT_WtoNE        0x00008000L    /* west to northeast    */
  43. #define BENT_WtoSE        0x00010000L    /* west to southeast    */
  44.  
  45. /* 90 degree corner-to-adjacent-corner lines */
  46. #define ANGLE_NEtoSE        0x00020000L    /* northeast to southeast */
  47. #define ANGLE_SEtoSW        0x00040000L    /* southeast to southwest */
  48. #define ANGLE_SWtoNW        0x00080000L    /* southwest to northwest */
  49. #define ANGLE_NWtoNE        0x00100000L    /* northwest to northeast */
  50.  
  51. /* 45 degree angle side-to-near-corner lines */
  52. #define SHARP_NtoNE        0x00200000L    /* north to northeast    */
  53. #define SHARP_EtoNE        0x00400000L    /* east to northeast    */
  54. #define SHARP_EtoSE        0x00800000L    /* east to southeast    */
  55. #define SHARP_StoSE        0x01000000L    /* south to southeast    */
  56. #define SHARP_StoSW        0x02000000L    /* south to southwest    */
  57. #define SHARP_WtoSW        0x04000000L    /* west to southwest    */
  58. #define SHARP_WtoNW        0x08000000L    /* west to northwest    */
  59. #define SHARP_NtoNW        0x10000000L    /* north to northwest    */
  60.  
  61. /* directions the cell can be reached from (point to previous cell) */
  62. #define FROM_NORTH        1
  63. #define FROM_NORTHEAST        2
  64. #define FROM_EAST        3
  65. #define FROM_SOUTHEAST        4
  66. #define FROM_SOUTH        5
  67. #define FROM_SOUTHWEST        6
  68. #define FROM_WEST        7
  69. #define FROM_NORTHWEST        8
  70. #define FROM_OTHERSIDE        9
  71.  
  72. #define    TOP    0
  73. #define BOTTOM    1
  74. #define EMPTY    0
  75. #define ILLEGAL    -1
  76.